<div ng-controller="z-attendance-c" z-loading is-loading="viewModel.isLoading">
	<div viewstack class="carousel slide" data-ride="carousel">
		<div class="carousel-inner" role="listbox">
			<div class="item active">
				<div class="row">
                    <div class="col-lg-12 heading">
                        <ul id="crumb" class="breadcrumb">
	                        <li>
		                        <i class="im-home"></i>
		                        <a href="index.html">首页</a>
	                        </li>
	                        <li ng-repeat="menu in viewModel.menuList">
	                        	<i class="{{menu.icons}}" ng-if="$index+1!=viewModel.menuList.length"></i>
	                        	<i class="en-arrow-right7" ng-if="$index+1==viewModel.menuList.length"></i>
	                        	{{menu.label}}
	                        </li>
                        </ul>
                    </div>
                </div>
                <div class="outlet">
                    <div class="row">
                        <div class="col-lg-12">
                            <!-- col-lg-12 start here -->

                                <table  class="table table-striped table-bordered" cellspacing="0" width="100%">
                                    <thead>
                                        <tr>
                                            <th>应出勤工时&nbsp<i class="en-help"></i></th>
                                            <th>迟到 </th>
                                            <th>早退 </th>
                                            <th>旷工 </th>
                                            <th>补签</th>
                                            <th>请假</th>
                                            <th>加班工时&nbsp<i class="en-help"></i></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>{{viewModel.shouldAttendanceTime}}(小时)</td>
                                            <td>({{viewModel.lateNumber!=""? viewModel.lateNumber:0}}次)</td>
                                            <td>({{viewModel.leaveEarlyNumber!=""? viewModel.leaveEarlyNumber:0}}次)</td>
                                            <td>{{viewModel.absenteeismNumber!=""? viewModel.absenteeismNumber:0}}(次)</td>
                                            <td>{{viewModel.retroactiveNumber!=""? viewModel.retroactiveNumber:0}}(次)</td>
                                            <td>{{viewModel.leaveNumber!=""? viewModel.leaveNumber:0}}(次)</td>
                                        	<td>{{viewModel.toHourMinute(viewModel.overTime)}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                        </div>
                    </div>
                </div>
                <div class="outlet">
	                <div class="panel-body">
	                    <form class="form-horizontal group-border hover-stripped" role="form" name="form">
	                        <div class="row">
	                        	<div class="col-xs-12 col-sm-10 col-md-12 form-box">
	                        	    <div class="col-sm-6 col-md-3 col-lg-3 form-item">
										<div class="col-sm-5 col-md-5 form-title">考勤状态：</div>
										<div class="col-sm-7 col-md-7 form-input">
											<div class="input-group" ng-class="{ 'has-error' : form.attendanceState.$invalid && !form.attendanceState.$pristine }">
												<select id="adlAttendanceState" class="form-control" ng-model="viewModel.attendanceStateList" tabIndex="1" multiple="multiple">
				                                </select>
											</div>
										</div>
									</div>
									<div class="col-sm-6 col-md-3 col-lg-3 form-item">
										<div class="col-sm-5 col-md-5 form-title">签到日期：</div>
										<div class="col-sm-7 col-md-7 form-input">
											<div class="input-group datapicker" ng-class="{ 'has-error' : form.attendanceStratDate.$invalid && !form.attendanceStratDate.$pristine }">
												<input name="attendanceStratDate" 
													   ng-model="viewModel.attendanceStratDate" 
													   class="form-control datetime-picker" 
													   type="text" 
													   autofocus="autofocus" 
													   ng-click="viewModel.startDateOpen($event)"
													   maxLength="10"
													   z-datepicker-popup="{{viewModel.format}}"
													   is-open="viewModel.startDateOpened"
													   datepicker-options="viewModel.dateOptions"
												       close-text="Close"
												       required
												       readonly
												       tabIndex="2">
												<span class="input-group-addon cursorPointer" ng-click="viewModel.startDateOpen($event)"><i class="fa-calendar"></i></span>
											</div>
										</div>
									</div>
									<div class="col-sm-6 col-md-3 col-lg-3 form-item">
										<div class="col-sm-3 col-md-3 form-title">至：</div>
										<div class="col-sm-8 col-md-8 form-input">
											<div class="input-group datapicker" ng-class="{ 'has-error' : form.attendanceEndDate.$invalid && !form.attendanceEndDate.$pristine }">
												<input name="attendanceEndDate" 
													   ng-model="viewModel.attendanceEndDate" 
													   class="form-control datetime-picker" 
													   type="text"
													   autofocus="autofocus" 
													   ng-click="viewModel.endDateOpen($event)"
													   maxLength="10"
													   z-datepicker-popup="{{viewModel.format}}"
													   is-open="viewModel.endDateOpened" 
													   datepicker-options="viewModel.dateOptions"
												       close-text="Close"
												       required
												       readonly
												       tabIndex="3">
												<span class="input-group-addon cursorPointer" ng-click="viewModel.endDateOpen($event)"><i class="fa-calendar"></i></span>
											</div>
										</div>
									</div>
									<div class="col-sm-6 col-md-3 col-lg-3 form-item">
										<div class="col-xs-12 col-sm-12 col-md-12">
											<button type="button" class="btn btn-success" ng-click="viewModel.validForm(form.$valid)" tabIndex="4">搜索</button>
										</div>
									</div>
								</div>
	                        </div>
	                        <div class="row">
	                        	<div class="col-xs-12 col-sm-12 col-md-12 form-box">
	                        		<div class="col-sm-12 col-md-12 col-lg-12 form-item">
										<div class="col-xs-12 col-sm-12 col-md-12">
											<!-- <button type="button" class="btn btn-warning" ng-click="viewAcrossModel.addAcrossR()" tabIndex="6">跨天补签</button> -->
											<button type="button" class="btn btn-primary" ng-click="viewRetroactiveModel.addRetroactive()">补签</button>
											<button type="button" class="btn btn-primary" ng-click="viewRetroactiveCancelModel.load()">撤回补签</button>
											<button type="button" class="btn btn-primary" ng-click="viewButtonModel.add(0)">休假申请</button>
											<button type="button" class="btn btn-primary" ng-click="viewButtonModel.add(1)">加班申请</button>
											<button type="button" class="btn btn-primary" ng-click="viewButtonModel.add(2)">出差申请</button>
											<button type="button" class="btn btn-primary" ng-click="viewButtonModel.add(3)">外出申请</button>
										</div>
									</div>
	                        	</div>
	                        </div>
	                    </form>
	                </div>
                </div>
				<div class="container-fluid" style="min-height: 300px;">
					<div class="row">
						<!-- <table class="table table-striped  table-bordered table-hover"> -->
						<table class="table table-striped table-bordered" cellspacing="0" width="100%">
							<thead>
								<tr>
									<th width="50px">
										选择
									</th>
									<th width="11%" ng-click="viewModel.order()" style="cursor:pointer;">
										签到日期
										<i ng-class="{true:'en-arrow-down3 ',false:'en-arrow-up3' }[viewModel.descSort]"></i>
									</th>
									<th width="11%">上班签到</th>
									<th width="11%">末班签退</th>
									<th width="11%">考勤状态</th>
									<th width="11%">补签状态</th>
									<th>备注</th>
									<!-- <th>操作</th> -->
								</tr>
							</thead>
							<tbody>
								<tr ng-repeat="attendance in viewModel.dataList">
									<td ng-style="viewModel.trStyle(attendance)">
										<input type="checkbox"  ng-model="attendance.checkbox" ng-disabled="viewModel.checkboxDisabled(attendance)"/>
									</td>
									<td ng-style="viewModel.trStyle(attendance)">{{attendance.attendanceDate | date:'yyyy/MM/dd'}}</td>
									<td ng-style="viewModel.trStyle(attendance)">{{attendance.originalStartTime}}
										<span ng-if="attendance.startTime!=null" class="green">
											<br ng-if="attendance.originalStartTime!=null">
										({{attendance.startTime}})
										</span>
										<span ng-if="attendance.specialStartTime!=null" class="red">
											<br ng-if="attendance.originalStartTime!=null||attendance.startTime!=null">
										({{attendance.specialStartTime}})
										</span>
									</td>
									<td ng-style="viewModel.trStyle(attendance)">{{attendance.originalEndTime}}
										<span ng-if="attendance.endTime!=null" class="green">
											<br ng-if="attendance.originalEndTime!=null">
										({{attendance.endTime}})
										</span>
										<span ng-if="attendance.specialEndTime!=null" class="red">
											<br ng-if="attendance.originalEndTime!=null||attendance.endTime!=null">
										({{attendance.specialEndTime}})
										</span>
									</td>
									<td ng-style="viewModel.trStyle(attendance)">
										<span ng-if="attendance.attendanceStateType==true">
										   <a ng-click="viewModel.selectUser(attendance) ">{{attendance.attendanceStateName}}
										   </a>
										</span>
										<span ng-if="attendance.attendanceStateType==false">
										   {{attendance.attendanceStateName}}
										</span>  
									</td>
									<td ng-style="viewModel.trStyle(attendance)">
										<a ng-click="viewModel.selectUsers(attendance)" ng-if="attendance.isRepaired!=0">{{attendance.isRepairedName}}</a>
									</td>
									<td ng-style="viewModel.trStyle(attendance)">{{attendance.description}}</td>
									<!-- <td>
										<span ng-if="attendance.attendanceState!=1 || attendance.attendanceState==9">
											<span style="display: inline-block;">
												<div class="btn-group dropdown btn-group-sm">
													<a href="javascript:void(0);" class="dropdown-toggle btn btn-success"
													   data-toggle="dropdown"
													   ng-init="dropdownItems=['休假申请','加班申请','出差申请','外出申请']" tabindex="7">
														申请 <b class="caret"></b>
													</a>
													<ul class="dropdown-menu attendance-drop">
														<li ng-repeat="item in dropdownItems">
														   <a href="javascript:void(0);" ng-click="viewButtonModel.add(attendance,$index)">{{item}}</a>
													    </li>
													</ul>
												</div>
											</span>
										    <button type="button" class="btn btn-sm btn-primary" ng-click="viewModel.addUser(attendance,0)" ng-if="!attendance.retroactiveStartType" ng-disabled="attendance.attendanceState==3">上班补签</button>
										   	<button type="button" class="btn btn-sm btn-warning" ng-click="viewModel.retractAttednance(attendance,0)" ng-if="attendance.retroactiveStartType" ng-disabled="attendance.attendanceState==3">撤回上班补签</button>
										    <button type="button" class="btn btn-sm btn-primary" ng-click="viewModel.addUser(attendance,1)" ng-if="!attendance.retroactiveEndType" ng-disabled="attendance.attendanceState==2">末班补签</button>
											<button type="button" class="btn btn-sm btn-warning" ng-click="viewModel.retractAttednance(attendance,1)" ng-if="attendance.retroactiveEndType" ng-disabled="attendance.attendanceState==2">撤回末班补签</button>
										</span>
									</td> -->
								</tr>
							</tbody>
						</table>
					</div>
					<div class="row">
						<div z-Pagination total-Data='viewModel.totalData'
							per-Page='viewModel.perPage'
							current-Page='viewModel.rowCount'
							on-Click="viewModel.bindData()"
							on-Change-Per-Page="viewModel.bindData()"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<z-Dialog show-Save-Btn="true" 
	have-Error-Class="false" 
	load-Url="static/html/attendance/attendanceEdit.html" 
	title="{{editModel.title}}" 
	show="viewModel.show"
	cancel-fn="viewModel.unLoad()"
	save-fn="viewModel.save()"
	body-Height="365"></z-Dialog>
	<z-Dialog show-Save-Btn="true" 
	have-Error-Class="false" 
	load-Url="static/html/attendance/retroactiveEdit.html" 
	title="申请补签" 
	show="viewRetroactiveModel.show"
	cancel-fn="viewRetroactiveModel.unLoad()"
	save-fn="viewRetroactiveModel.save()"
	body-Height="500"></z-Dialog>
	<z-Dialog 
	have-Error-Class="false" 
	load-Url="static/html/attendance/attendanceSelect.html" 
	title="{{editModel.title}}" 
	show="viewModel.showSelect"
	cancel-fn="viewModel.unLoadSelect()"
	></z-Dialog>
	<z-Dialog 
	have-Error-Class="false" 
	load-Url="static/html/attendance/retroactiveSelect.html" 
	title="{{editModel.title}}" 
	show="viewModel.showSelects"
	cancel-fn="viewModel.unLoadSelects()"
	></z-Dialog>
	<z-Dialog show-Save-Btn="true" 
	have-Error-Class="false" 
	load-Url="static/html/attendance/acrossTheDayREdit.html" 
	title="跨天补签"
	show="viewAcrossModel.show"
	cancel-fn="viewAcrossModel.unLoad()"
	save-fn="viewAcrossModel.save()"
	body-Height="500"></z-Dialog>
	<z-Dialog show-Save-Btn="false" 
	have-Error-Class="false" 
	load-Url="static/html/attendance/Button.html" 
	title="申请"
	show="viewButtonModel.show"
	cancel-fn="viewButtonModel.unLoad()"
	save-fn=""
	body-Height="300"></z-Dialog>
	<!-- <z-Dialog show-Save-Btn="true" 
	show-Submit-Btn="true"
	have-Error-Class="false" 
	load-Url="static/html/workOvertime/workOvertimeEdit.html" 
	title="{{editModel.title}}" 
	show="viewModel.show"
	cancel-fn="viewModel.unLoad()"
	save-fn="viewModel.save()"
	submit-fn="viewModel.saveSubmit()"
	body-Height="600"></z-Dialog> -->

	<z-Dialog show-Save-Btn="true" show-Submit-Btn="true"
			  have-Error-Class="false"
			  load-Url="static/html/attendance/vacationEdit.html"
			  title="{{viewButtonModel.title}}"
			  show="viewButtonModel.show0"
			  cancel-fn="viewButtonModel.unLoad()"
			  save-fn="viewButtonModel.save0()"
			  submit-fn="viewButtonModel.saveSubmit0()"
			  body-Height="465"></z-Dialog>

	<z-Dialog show-Save-Btn="true"
			  show-Submit-Btn="true"
			  have-Error-Class="false"
			  load-Url="static/html/attendance/workOvertimeEdit.html"
			  title="{{viewButtonModel.title}}"
			  show="viewButtonModel.show1"
			  cancel-fn="viewButtonModel.unLoad()"
			  save-fn="viewButtonModel.save1()"
			  submit-fn="viewButtonModel.saveSubmit1()"
			  body-Height="390"></z-Dialog>
	<z-Dialog show-Save-Btn="true" 
			  show-Submit-Btn="true"
			  have-Error-Class="false"
			  load-Url="static/html/attendance/businessTripEdit.html"
			  title="{{viewButtonModel.title}}"
			  show="viewButtonModel.show2"
			  cancel-fn="viewButtonModel.unLoad()"
			  save-fn="viewButtonModel.save2()"
			  submit-fn="viewButtonModel.saveSubmit2()"
			  body-Height="400"></z-Dialog>
	<z-Dialog show-Save-Btn="true" 
			  show-Submit-Btn="true"
			  have-Error-Class="false"
			  load-Url="static/html/attendance/goOutEdit.html"
			  title="{{viewButtonModel.title}}"
			  show="viewButtonModel.show3"
			  cancel-fn="viewButtonModel.unLoad()"
			  save-fn="viewButtonModel.save3()"
			  submit-fn="viewButtonModel.saveSubmit3()"
			  body-Height="400"></z-Dialog>
	<z-Dialog show-Save-Btn="true" 
			  show-Submit-Btn="false"
			  have-Error-Class="false"
			  load-Url="static/html/attendance/retroactiveCancel.html"
			  title="撤回补签"
			  show="viewRetroactiveCancelModel.show"
			  cancel-fn="viewRetroactiveCancelModel.unLoad()"
			  save-fn="viewRetroactiveCancelModel.save()"
			  body-Height="400"></z-Dialog>
</div>